const Sequelize = require('sequelize'); //引入Sequelize模块
const sequelize = require('../db');
const db = require('../db');

//定义model
const Sign = db.define('Sign', {
    //主键
    id: { type: Sequelize.BIGINT, primaryKey: true, allowNull: false },
    //班级
    class: { type: Sequelize.STRING(10), allowNull: false },
    //姓名
    studentname: { type: Sequelize.STRING(5), allowNull: false },
    //角色
    role: { type: Sequelize.STRING(10), allowNull: false },
    //签到标记
    sign: { type: Sequelize.INTEGER },
    //设定签到标记
    signKey: { type: Sequelize.INTEGER },
    //设定纬度
    //signLatitude: { type: Sequelize.DOUBLE(255,5) },
    //设定经度
    //signLongitude: { type: Sequelize.DOUBLE(255,5) },
    //签到发起时间
    signTime:{ type: Sequelize.STRING(255) },
    //设定纬度
    latitude: { type: Sequelize.DOUBLE(255,5) },
    //设定经度
    longitude: { type: Sequelize.DOUBLE(255,5) },
    //创建时间
    createdAt: { type: Sequelize.DATE },
    //修改时间
    updatedAt: { type: Sequelize.DATE }
}, {
    underscored: true,
    tableName: 'sign',
});

module.exports = Sign;